<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'test'); //test环境下会显示错误的详细信息


require_once '../yii2-framework/autoload.php';
require_once '../yii2-framework/yiisoft/yii2/Yii.php';


$config = [
    'id' => 9999,
    'basePath' => dirname(__DIR__),
    'language' => 'zh-CN',
    'components' => [
        'request' => [
            'class' => 'yii\web\Request',
            'cookieValidationKey' => 'xxxxxxx'
        ],
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=127.0.0.1;dbname=test',
            'username' => 'root',
            'password' => '123456',
            'charset' => 'utf8',
        ],
    ],
    'modules' => [
        'admin' => ['class' => 'app\modules\admin\AdminModule'],
    ]
];

(new \yii\web\Application($config))->run();


